@extends('layouts.base') @section('content') @parent
<div id="wrapper">
	<div class="main-content container">
		<div class="row small-space">
			<div class="col-md-9">
				<div class="box-content">
					<h4>添加单词分类</h4>
                    <hr>
					<form method="post" action="">
						{{csrf_field()}}
                        <div class="col-md-6">
						<div class="form-group">
							<label for="slug">分类</label>
							<select class="form-control" name="category_id" id="cat" required>
								@foreach($cats as $cat)
								<option value="{{$cat->id}}">{{$cat->name}}</option>
								@endforeach
							</select>
						</div></div>
						<div class="form-group">
							<textarea name="words" cols="80" rows="20" required></textarea>

						</div>
						<div class="form-group">
							<button type="submit" class="btn btn-primary waves-effect waves-light">提交</button>
                            <button type="button" class="btn btn-default waves-effect waves-light">取消</button>
						</div>
					</form>
				</div>
			</div>
			<div class="col-md-3">
				<a href="" class="btn btn-danger btn-mail-main btn-block margin-bottom-20 waves-effect waves-light">词汇分类</a>
			<div class="box box-solid">
				<div class="box-body">
					<ul class="nav nav-pills nav-stacked">
						@foreach($cats as $cat)
						<li>
							<a href="{{route('word.index',$cat->slug)}}">
								<i class="fa fa-inbox"></i> {{$cat->name}}
								<span class="label-right bg-info pull-right">{{$cat->words()->count()}}</span>
							</a>
						</li>
						@endforeach
					</ul>
				</div>
				<!-- /.box-body -->
			</div>
			</div>
		</div>
	</div>
</div>
<!-- /.main-content -->
</div>
@endsection